package cn.iocoder.yudao.module.shop.convert.priceitem;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;

import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
import cn.iocoder.yudao.module.shop.controller.admin.priceitem.vo.*;
import cn.iocoder.yudao.module.shop.dal.dataobject.priceitem.ShopPriceItemDO;

/**
 * 价格单项 Convert
 *
 * @author 曹建伟
 */
@Mapper
public interface ShopPriceItemConvert {

    ShopPriceItemConvert INSTANCE = Mappers.getMapper(ShopPriceItemConvert.class);

    ShopPriceItemDO convert(ShopPriceItemCreateReqVO bean);

    ShopPriceItemDO convert(ShopPriceItemUpdateReqVO bean);

    ShopPriceItemRespVO convert(ShopPriceItemDO bean);

    List<ShopPriceItemRespVO> convertList(List<ShopPriceItemDO> list);

    PageResult<ShopPriceItemRespVO> convertPage(PageResult<ShopPriceItemDO> page);

    List<ShopPriceItemExcelVO> convertList02(List<ShopPriceItemDO> list);

    default ShopPriceItemCreateReqVO convertCreate(Long priceId, Long itemId, Integer price, Long tenantId){
        ShopPriceItemCreateReqVO createReqVO = new ShopPriceItemCreateReqVO();
        createReqVO.setPrice(price);
        createReqVO.setPriceId(priceId);
        createReqVO.setItemId(itemId);
        createReqVO.setTenantId(tenantId);

        return createReqVO;
    }

    default ShopPriceItemUpdateReqVO convertUpdate(Long id, Long priceId, Long itemId, Integer price){
        ShopPriceItemUpdateReqVO updateReqVO = new ShopPriceItemUpdateReqVO();
        updateReqVO.setId(id);
        updateReqVO.setPrice(price);
        updateReqVO.setPriceId(priceId);
        updateReqVO.setItemId(itemId);

        return updateReqVO;
    }

}
